#./thirdparty/librabbitmq/Makefile
SOURCES = $(wildcard *.c)
OBJS = $(patsubst %.c,%.o,$(notdir $(SOURCES)))
OBJSD = $(addprefix $(TMP_DIR)librabbitmq/,$(OBJS))

INCLUDE = -DAMQP_STATIC -DAMQP_BUILD -DHAVE_SELECT -DAMQ_PLATFORM=\"Linux\" \
          -I ./ -I ./unix

all:chkdir librabbitmq$(TAGTYPE)

chkdir:
	$(shell mkdir -p $(TMP_DIR)librabbitmq/)

librabbitmq_static:$(OBJS)
	$(AR) $(OUT_DIR)librabbitmq.a $(OBJSD)

librabbitmq_shared:$(OBJS)
	$(CC) -shared -fPIC $(OBJSD) -o $(OUT_DIR)librabbitmq.so

$(OBJS):%.o:%.c
	$(CC) $(INCLUDE) $(CFLAGS) -c $< -o $(TMP_DIR)librabbitmq/$@

clean:
	rm -rf $(TMP_DIR)librabbitmq/*.o